from threading import Lock, Thread


# 多线程
# 多线程
# 多线程
# 多线程

def sing(name):
    print(f"{name}:在唱歌")


def dance(name):
    print(f"{name}:在跳舞")


if __name__ == "__main__":
    # 创建线程,方法参数以元组的形式传参
    t1 = Thread(target=sing, args=("我是",))
    t2 = Thread(target=dance, args=("老师",))
    t1.start()
    # t1.join()
    t2.start()

# 线程同步

# join()

# 互斥锁 ,必须成对出现
Lock.acquire()  # 加锁
Lock.release()  # 释放锁
